#include "gtest/gtest.h"

#include "Graph.h"
#include "Dijkstra.h"

class DijkstraTest : public ::testing::Test {
	protected:
		virtual void SetUp() {
		}
		virtual void TearDown() {
		}

	public:
};

TEST_F(DijkstraTest, test1) {
	Graph g(4, false);
	g.addEdge(0, 1, 10);
	g.addEdge(0, 2, 20);
	g.addEdge(0, 3, 60);
	g.addEdge(1, 3, 40);
	g.addEdge(2, 3, 20);

	vector<int> expectedDistance;
	expectedDistance.push_back(0);
	expectedDistance.push_back(10);
	expectedDistance.push_back(20);
	expectedDistance.push_back(40);

	Dijkstra dq(g);
	dq.singleSourceShortest(0);

	ASSERT_EQ(expectedDistance, dq.getDistance());
}

